ag_qualities_mat = ones(n_varieties_ag,n_countries);
manu_qualities_mat = ones(n_varieties_manu,n_countries);
serv_qualities_mat = ones(n_varieties_serv,n_countries);

for cc = 1:length(country)
ag_qualities_mat(:,cc) = Frechet_draws(ag_T_vec(cc),theta_ag,n_varieties_ag);
end
ag_qualities_mat_3D = repmat(ag_qualities_mat,1,1,n_countries);

for cc = 1:length(country)
manu_qualities_mat(:,cc) = Frechet_draws(manu_T_vec(cc),theta_manu,n_varieties_ag);
end
manu_qualities_mat_3D = repmat(manu_qualities_mat,1,1,n_countries);

for cc = 1:length(country)
serv_qualities_mat(:,cc) = Frechet_draws(serv_T_vec(cc),theta_manu,n_varieties_ag);
end
serv_qualities_mat_3D = repmat(serv_qualities_mat,1,1,n_countries);

wage_guess_mat = repmat(wage_guesses,n_varieties_ag,1);
wage_guess_mat_3D = repmat(wage_guess_mat,1,1,n_countries);
ag_consumed_prices_mat = wage_guess_mat./ag_qualities_mat;
manu_consumed_prices_mat = wage_guess_mat./manu_qualities_mat;
serv_consumed_prices_mat = wage_guess_mat./serv_qualities_mat;